﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ArtClub.Controller;
using ArtClub.DBAL;
using System.ComponentModel;

namespace ArtClub
{
    public partial class BrowseCatalogue : System.Web.UI.Page
    {
        private DataDiagramDataContext dataContext = new DataDiagramDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            PieceCtr controler = new PieceCtr();
            Repeater1.DataSource = controler.getAllPieces();
            Repeater1.DataBind();
            if (Repeater1.DataSource == null)
            {
                divEmpty.Visible = true;
            }
        }

        protected void Repeater1_ItemDataBound1(object sender, RepeaterItemEventArgs e)
        {
            Image img = e.Item.FindControl("imgPiece") as Image;
            Piece piece = e.Item.DataItem as Piece;
            img.ImageUrl = piece.image;
        }
    }
}